//Islsp
//$Id: islsp_ga_sa_omp.cpp 605 2010-11-27 15:10:07Z Oleg.Bulychov $
#include "stdafx.h"

#include "projects/islsp/ga/islsp_ga.h"
#include "projects/islsp/sa/islsp_sa.h"
#include "src/heo/include/run_omp.h"
#define WEAK
#ifdef WEAK
#include "solvers/hybrids/weak_hybrid.h"
#include "solvers/ga/ga_omp.h"
#include "solvers/sa/sa_omp.h"
#else
#include "solvers/hybrids/ga_sa/ga_sa_omp.h"
#endif


typedef Islsp_Problem         TProblem;
typedef Islsp_Solution        TSolution;
typedef Islsp_Config          TConfig;
typedef Islsp_History         THistory; 

typedef Environment<TProblem, TSolution, TConfig, THistory>      TEnvironment;

#ifdef WEAK

typedef struct GA_Traits<TEnvironment, validator_ga_tag> TTraits;
typedef GA_OMP<TTraits>                                  TSolver;

typedef struct SA_Traits<TEnvironment>                   TTraits2;
typedef SA_OMP<TTraits2>                                 TSolver2;

#else

typedef struct GA_Traits<TEnvironment, validator_ga_sa_tag> TTraits;
typedef GA_OMP<TTraits>                                     TSolver;

#endif

static struct ga_register
{
    ga_register()
    {
        TSolver::register_Selection< ga::selection::tournament_selection >();
        TSolver::register_Selection< ga::selection::roulette_selection >();
        TSolver::register_Selection< ga::selection::random_selection >();

        TSolver::register_Operator< ga::inter_operator::crossover>();
        TSolver::register_Operator< ga::inter_operator::mutation>();
#ifndef WEAK
        TSolver::register_Operator< ga::inter_operator::sa >();
#endif
    }
} reg;

int main(int argc, char* argv[])
{
#ifdef WEAK
    return Run_OMP< weak_hybrid<TSolver, TSolver2, check_point_omp> >(argc, argv);
#else
    return Run_OMP< TSolver >(argc, argv);
#endif
}
//EOF!
